package com.FanXing.Method;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        String rs=test("java");
        System.out.println(rs);

        ArrayList<Car>cars=new ArrayList<>();
        cars.add(new BENZ());
        cars.add(new BMW());
        go(cars);

        ArrayList<BENZ>benzs=new ArrayList<>();
        benzs.add(new BENZ());
        benzs.add(new BENZ());

       Dog d= test(new Dog());
       System.out.println(d);
    }
    public static void go(ArrayList<? extends Car>cars){//?表示所有类//表示Car或Car的子类；

    }
//    public static <T extends Car>void go(ArrayList<T>cars){
//
//    }
    public static <T> T test(T t){
        return t;
    }
}
